package com.autumn.zero.workflow.values;

import org.hibernate.validator.constraints.Length;

import com.autumn.common.api.application.DataValidation;
import com.autumn.domain.vo.AbstractValue;
import com.autumn.validation.ValidationUtils;
import com.autumn.validation.annotation.NotNullOrBlank;
import com.autumn.zero.workflow.entitys.WorkflowUserTaskComplete;

/**
 * 任务处理值抽象
 * 
 * @author 杨昌国 2019-01-28 19:28:36
 */
public abstract class AbstractProcessTaskValue extends AbstractValue implements DataValidation {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1556398296338222483L;

	@NotNullOrBlank(message = "任务id不能为空")
	private String taskId;

	@NotNullOrBlank(message = "用户id不能为空")
	private String userId;

	@NotNullOrBlank(message = "用户名称不能为空")
	@Length(max = WorkflowUserTaskComplete.MAX_USER_NAME_LENGTH, message = "用户名称长度不能超过"
			+ WorkflowUserTaskComplete.MAX_USER_NAME_LENGTH + "个字。")
	private String userName;

	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Override
	public void valid() {
		ValidationUtils.validation(this);
	}
}
